#!/bin/bash

file_dws_dir="/root/aml/dws"
etl="`date -d '-1 days' +"%Y-%m-%d"`"

nohup hive -hivevar dt=$etl -f "$file_dws_dir"dws_inc_dws_aml_customer_risk_profile.sql > /root/aml/dws/log/dws_aml_customer_risk_profile
_"$etl".log &

nohup hive -hivevar dt=$etl -f "$file_dws_dir"dws_inc_dws_aml_transaction_behavior.sql > /root/aml/dws/log/dws_aml_transaction_behavior_"$etl".log &

nohup hive -hivevar dt=$etl -f "$file_dws_dir"dws_inc_dws_aml_risk_dashboard.sql > /root/aml/dws/log/dws_aml_risk_dashboard_"$etl".log &

rm -rf `find /root/aml/dws/log -mtime 2`
